<%@ page language="java" import="java.util.*" pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
 <%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head> 
    <link rel="stylesheet" href="<s:url value="/resources"/>/css/common.css" type="text/css" />
    <link rel="stylesheet" href="<s:url value="/resources"/>/css/innerstyle.css" type="text/css" />   
    <link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/cupertino/jquery-ui.custom.min.css" />
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-ui.custom.min.js"></script> 
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.form.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/json2.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/messages_zh.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<style type="text/css">
	.content_gridview
	{
		margin:0px;	
		padding:0px;
		width:99%;
		text-align:left;
		font-size:12px;
		border-left:#cad1dd 1px solid;
		border-top:#cad1dd 1px solid;
		border-color:"#000";
	}
	.content_gridview th
	{
		padding:0px;
		
		height:26px;
		line-height:26px;
		text-align:center;
		
		border-right:#cad1dd 1px solid;
		border-bottom:#cad1dd 1px solid;
		border-color:"#000";
		/* background-image:url(../images/th.gif); */
		background-repeat:repeat-x;
		background-position:top;
	}
	
	.content_gridview td
	{
		padding:0px;
		height:24px;
		line-height:24px;
		text-align:center;
		border-right:#cad1dd 1px solid;
		border-bottom:#cad1dd 1px solid;
		border-color:"#000";
	}
	
	.longtextbox
	{
		width:320px;
		border:#cad1dd 1px solid;
	}
	
	.textarea
	{
	    overflow:auto;	
		border:#cad1dd 1px solid;
			
	}
	
	label.error {
	color: red; /*错误信息的颜色*/
	}
	
	input.error {
		border: 1px dotted red; /*输入错误的输入框的边框样式*/
	}
</style>
<script type='text/javascript'>
	$(function(){ 
	    $("#but1").button();
	    $("#but2").button(); 
	    $("#but3").button(); 
		//提交
	    $("#but1").click(function () {
             $( "#dialog-confirm" ).dialog({
			            //autoOpen: false,            
						resizable: false,
						height:140,
						modal: true,
						buttons: {
							"确认": function() {
							     var sysid = $("#sysid").val(); 
							     tij(sysid);
							},
							"返回": function() {
								$( this ).dialog( "close" );
							}
						}
			   });  
          });
          //撤销
	      $("#but2").click(function () {
             $( "#dialog-confirm1" ).dialog({
			            //autoOpen: false,            
						resizable: false,
						height:140,
						modal: true,
						buttons: {
							"确认": function() {
							     var sysid = $("#sysid").val(); 
							     batchchex(sysid);
							},
							"返回": function() {
								$( this ).dialog( "close" );
							}
						}
			   });  
          });
          
     });
     
       //提交
		function tij(sysid) {	
			var url = "<s:url value="/hwjs"/>/tijHwjsBatch?sysid="+sysid;
			$.post(url, function(data) {
				var obj = eval('(' + data + ')');
				if(obj.success==true){
				        alert(obj.msg);
				        location.href ="<s:url value="/hwjs"/>/directHwjflr";
				 }else{
				         alert(obj.msg);
				 }
                 }
                 );
            // $("#dialog-confirm").dialog( "close" );
		}
		
		
		//撤销
		function batchchex(sysid) {	
			var url = "<s:url value="/hwjs"/>/chexHwjsBatch?sysid="+sysid;
			$.post(url, function(data) {
				var obj = eval('(' + data + ')');
				if(obj.success==true){
				        alert(obj.msg); 
				        location.href ="<s:url value="/hwjs"/>/directHwjflr";
				 }else{
				         alert(obj.msg);
				       }
                 });
		}
		
		
	</script>
  </head>
  
 <body>
<div id="best1">
<h2><span>货物交付录入</span></h2>
    <table id="changdi" align="center" cellpadding="0" cellspacing="0" class="content_gridview">
          <tr>
               <input type="hidden" id="sysid" value="${hwjf.sysid}"/>
               <td>合同号：</td>
               <td style="text-align:left"><span>${hwjf.hetbh}</span></td>
               <td>交收月份：</td>
               <td style="text-align:left"><span>${hwjf.jiaoshyf}</span></td>
          </tr>
          <tr>
               <td>出卖人：</td>
               <td style="text-align:left"><span>${hwjf.chumr}</span></td>
               <td>买受人：</td>
               <td style="text-align:left"><span>${hwjf.maishr}</span></td>
           </tr>
           <tr>
               <td>发货单位：</td>
               <td style="text-align:left"><span>${hwjf.fahdw}</span></td>
               <td>收货单位：</td>
               <td style="text-align:left"><span>${hwjf.shouhdw}</span></td>
           </tr>
           <tr>
               <td>卖方结算单位：</td>
               <td style="text-align:left"><span>${hwjf.maifjsdw}</span></td>
               <td>买方结算单位：</td>
               <td style="text-align:left"><span>${hwjf.shouhfjsdw}</span></td>
           </tr>
           <tr>
               <td>发站：</td>
               <td style="text-align:left"><span>${hwjf.fazhmc}</span></td>
               <td>到站：</td>
               <td style="text-align:left"><span>${hwjf.daozhmc}</span></td>
           </tr>
            <tr>
               <td>执行单价：</td>
               <td style="text-align:left"><span>${hwjf.zhixdj}</span></td>
               <td>交收量：</td>
               <td style="text-align:left"><span>${hwjf.jiaoshl}</span></td>
           </tr>
           <tr>
               <td>应收货款：</td>
               <td style="text-align:left"><span>${hwjf.yingfhk}</span></td>
               <td>应收运杂费：</td>
               <td style="text-align:left"><span>${hwjf.yingfyzf}</span></td>
           </tr>
            <tr>
               <td>应收其他费用：</td>
               <td style="text-align:left"><span>${hwjf.yingfqtfy}</span></td>
               <td>&nbsp;</td>
               <td>&nbsp;</td>
           </tr>
           <tr>
               <td>注备：</td>
               <td colspan="3" style="text-align:left"><span>${hwjf.beizh}</span></td>
           </tr>
           <tr>
		    <td colspan="4" style="text-align:right">
		        <c:if test="${hwjf.danjzht == 0 }"><input id="but1" type="button" value="提交" />&nbsp;&nbsp;&nbsp;</c:if>
		        <c:if test="${hwjf.danjzht == 1 }"><input id="but2" type="button" value="撤回" />&nbsp;&nbsp;&nbsp;</c:if>
			    <input id="but3" type="button" name="" value="返回" onclick="javascript:history.back();"/>
		    </td>
		    <tr>
		     <td colspan="4" style="text-align:left;">	
               <span style="color: red;font-size:12px;vertical-align:left;">
	             &nbsp;&nbsp;&nbsp;&nbsp; 使用说明：<br>
	             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、同一份合同按照货物实际交付情况可多次录入货物交付单。<br>
	             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、此货物交付单保存后还可以再次编辑修改，提交后不可以再进行编辑操作且数据作为统计依据。 
		       </span>
		      </td> 
           </tr>
        </tr>
     </table>
</div> 
<div id="dialog-confirm" title="是否确认提交？"></div>
<div id="dialog-confirm1" title="是否确认撤回？"></div>
  </body>
</html>
